const { resolve, join } = require('path')

// webpack 自定义配置
module.exports = {
  entry: {
    index: './src/index.js',
    about: './src/about.js'
  },
  output: {
    path: resolve(__dirname, 'release')
  },
  devServer: {
    host: '0.0.0.0',
    port: 80,
    static: join(__dirname, 'public'),
    compress: true,
    // open: true,
    // historyApiFallback: true,
    hot: true,
    https: false,
    // 后端开发服务器的代理
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        secure: false,
        server: 'http',
        ws: false,
        pathRewrite: { '^/api': '' }
      }
    },
    // 客户端配置
    client: {
      logging: 'info',
      // overlay: true,
      overlay: {
        errors: true,
        warnings: false
      }
      // progress: true
    }
  }
}
